<?PHP
session_start();
$active = 'flyers';
if(!isset($_SESSION['id']))
{
	header('Location: http://www.realivent.com/login.php');
}

$listing_id = $_GET['listing_id'];
require('../db/opendb.php');
require('template_functions.php');
require_once 'SOAP/Client.php';
$wsdl = new SOAP_WSDL('http://realivent.com/soap/soap.php?wsdl');
$googleProxy = $wsdl->getProxy();
$out = $googleProxy->get_Listing_Details($listing_id);
//print_r($out);

$output = get_code($out, $_GET['template'], $listing_id, $_SESSION['memberships']);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Realivent -- Listing Designer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../accounts/style.css">
</head>
<body>
<CENTER>
<table width="1000" border="0" cellspacing="0" cellpadding="0">
<TR><tD><?php include('../../accounts/accounts_top_navigation.php'); ?></tD></TR>
  <tr>
    <td valign="top">
	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="150" valign="top" align="left">
<div id="leftCol"><br/><br/>
		 <?php
		 if(isset($_SESSION['id']) && $row['disp_profile'] != 'No')
		 {
		 include("../../accounts/accounts_left_navigation.php");
		 }
		 ?>
	</div>	<!-- Left Column -->
	</td>
    <td width="900" valign="top">
	<div style="padding-bottom:3px; padding-top:25px;"><a href=view_templates.php?listing_id=<?php echo $listing_id ?>>Back to Templates</a> | <a href=get_code.php?listing_id=<?php echo $listing_id ?>&template=<?php echo $_GET['template'] ?>>I like it, I want to post it</a></div>
			<BR>
			<?php
echo $output;
?>
	<DIV style="height:10px;"></DIV>
	<BR><BR>
			</td>
		  </tr>
		</table>
	</td>
  </tr>
  <tr>
   	<td><?php include('../../footer.php'); ?></td>
  </tr>
</table>
</div>
</body>
</html>